#ifndef CONTROLWIDGET_H
#define CONTROLWIDGET_H

#include <QDialog>
#include <QDebug>
#include <QDialogButtonBox>

#include <QTreeWidget>
#include <QStackedWidget>
#include <QHBoxLayout>
#include "src/UI/childWidget/RobotUI.h"
#include "src/UI/childWidget/CameraUI.h"
#include "src/UI/childWidget/LaserUI.h"
#include "src/UI/childWidget/WeldUI.h"
#include "src/UI/childWidget/MachineUI.h"
#include "src/UI/childWidget/LightUI.h"

#include "src/UI/childWidget/Motion/FilePos.h"
#include "src/UI/childWidget/Motion/HandMoveUI.h"

#include "src/UI/childWidget/Model/FixtureUI.h"
#include "src/UI/childWidget/Model/ObservedUI.h"
#include "src/UI/childWidget/Charts/LineChart.h"
#include "src/UI/childWidget/Charts/HorBarChart.h"


namespace Ui {
class ControlWidget;
}

class ControlWidget : public QDialog
{
    Q_OBJECT

public:
    explicit ControlWidget(QWidget *parent = 0);
    ~ControlWidget();

private slots:
    void on_treeWidget_itemActivated(QTreeWidgetItem *item, int column);

    void on_treeWidget_activated(const QModelIndex &index);

private:
    void initUIWidget();

    void initChildWidgets();

private:
    Ui::ControlWidget *ui;
    QDialogButtonBox *buttonBox;

    QStackedWidget *_stack;
    QHBoxLayout *_layout;
    QVBoxLayout *_UIlayout;


    /* Member UI  */
private:
    RobotUI   *_robotUI;
    CameraUI  *_camraUI;
    LaserUI   *_laserUI;
    WeldUI    *_weldUI;
    MachineUI *_machineUI;
    LightUI   *_lightUI;

    FilePos         *filePos;
    HandMoveUI      *_handMoveUI;

    FixtureUI       *_fixtureUI;
    ObservedUI      *_observedUI;

    LineChart       *_lineChart;
    HorBarChart     *_horBarChart;

    /* Member Object */
private:
    QStringList content;
};

#endif // CONTROLWIDGET_H
